<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set options on a given XSLT processor</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.xslt-set-scheme-handlers.html">xslt_set_scheme_handlers</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.html">PHP 核心：骇客指南</a></div>
 <div class="up"><a href="ref.xslt.html">XSLT (PHP 4) 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.xslt-setopt" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xslt_setopt</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0)</p><p class="refpurpose"><span class="refname">xslt_setopt</span> &mdash; <span class="dc-title">Set options on a given XSLT processor</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.xslt-setopt-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><strong>xslt_setopt</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$processor</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$newmask</code></span>
   )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>xslt_setopt()</strong></span> sets the options specified by
   <em><code class="parameter">newmask</code></em> on the given <em><code class="parameter">processor</code></em>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xslt-setopt-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<em><code class="parameter">
processor</code></em></dt>
<dd>
<p class="para"><acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym> 处理器连接标识符，由
<span class="function"><a href="function.xslt-create.html" class="function">xslt_create()</a></span> 创建。</p></dd>


    
     <dt>
<em><code class="parameter">newmask</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">newmask</code></em> is a bitmask constructed with the
       following constants:
       <ul class="itemizedlist">
        <li class="listitem">
         <p class="para">
          <strong><code>XSLT_SABOPT_PARSE_PUBLIC_ENTITIES</code></strong> - Tell the
          processor to parse public entities. By default this has been turned
          off.
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code>XSLT_SABOPT_DISABLE_ADDING_META</code></strong> - Do not add
          the meta tag &quot;Content-Type&quot; for HTML output. The default is set
          during the compilation of the processor.
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code>XSLT_SABOPT_DISABLE_STRIPPING</code></strong> - Suppress the
          whitespace stripping (on data files only).
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code>XSLT_SABOPT_IGNORE_DOC_NOT_FOUND</code></strong> - Consider
          unresolved documents (the document() function) non-lethal.
         </p>
        </li>
       </ul>
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xslt-setopt-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the number of previous mask is possible, <strong><code>TRUE</code></strong> otherwise,
   <strong><code>FALSE</code></strong> in case of an error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.xslt-setopt-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5441">
    <p><strong>Example #1 <span class="function"><strong>xslt_setopt()</strong></span> Example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$xh&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">xslt_create</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">//&nbsp;Tell&nbsp;Sablotron&nbsp;to&nbsp;process&nbsp;public&nbsp;entities<br /></span><span style="color: #0000BB">xslt_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">XSLT_SABOPT_PARSE_PUBLIC_ENTITIES</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Let's&nbsp;also&nbsp;ask&nbsp;it&nbsp;to&nbsp;suppress&nbsp;whitespace&nbsp;stripping<br /></span><span style="color: #0000BB">xslt_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">xslt_getopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">)&nbsp;|&nbsp;</span><span style="color: #0000BB">XSLT_SABOPT_DISABLE_STRIPPING</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.xslt-setopt-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.xslt-getopt.html" class="function" rel="rdfs-seeAlso">xslt_getopt()</a> - Get options on a given xsl processor</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.xslt-set-scheme-handlers.html">xslt_set_scheme_handlers</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.html">PHP 核心：骇客指南</a></div>
 <div class="up"><a href="ref.xslt.html">XSLT (PHP 4) 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
